home *** CD-ROM | disk | FTP | other *** search
/ Ultra Gameplayers 101 / Ultra Game Players Magazine, No. 101 - September 1997 (Imagine Publishing, Inc.)(1997).iso / pc / new_ugp.dxr / 00211_Game Manager Class.ls < prev    next >
Encoding:
Text File  |  1997-07-10  |  1.8 KB  |  61 lines

  1. property gameList, memberNum, normalColor, hiliteColor, killList
  2.  
  3. on new me, paramList
  4.   set killList to []
  5.   set gameList to getProp(paramList, #gameList)
  6.   set memberNum to getProp(paramList, #memberID)
  7.   set normalColor to getaProp(paramList, #normalColor)
  8.   set hiliteColor to getaProp(paramList, #hiliteColor)
  9.   if stringp(memberNum) then
  10.     set memberNum to the number of member memberNum
  11.   end if
  12.   if (memberNum > 0) and (normalColor >= 0) then
  13.     set the foreColor of member memberNum to translateColor(normalColor)
  14.   end if
  15.   set the stageColor to the stageColor
  16.   return me
  17. end
  18.  
  19. on TurnOn me, spritenum, lineNum
  20.   if memberNum <= 0 then
  21.     set memberNum to the memberNum of sprite spritenum
  22.   end if
  23.   set currName to line lineNum of the text of member memberNum
  24.   set currGame to 0
  25.   repeat with game in gameList
  26.     if the name of game = currName then
  27.       set currGame to game
  28.       exit repeat
  29.     end if
  30.   end repeat
  31.   if objectp(currGame) then
  32.     set the foreColor of member memberNum to translateColor(normalColor)
  33.     if isMac() then
  34.       if lineNum = the number of lines in the text of the member of sprite spritenum then
  35.         set the text of the member of sprite spritenum to the text of the member of sprite spritenum & RETURN
  36.       end if
  37.     end if
  38.     set the foreColor of line lineNum of member memberNum to translateColor(hiliteColor)
  39.     set the stageColor to the stageColor
  40.     DoGame(currGame)
  41.   else
  42.     set nameList to "|"
  43.     repeat with game in gameList
  44.       set nameList to nameList & the name of game & "|"
  45.     end repeat
  46.     put "No game match: name:" && currName && "game list:" && nameList
  47.   end if
  48. end
  49.  
  50. on TurnOff me
  51. end
  52.  
  53. on dispose me
  54.   set memberNum to 0
  55.   set normalColor to 0
  56.   set hiliteColor to 0
  57.   set gameList to []
  58.   ClearObjectList(killList)
  59.   set killList to []
  60. end
  61.